package ks.client.controllers;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JFrame;
import javax.swing.JList;

import ks.client.UserContext;
import ks.client.controllers.commands.JoinCommandController;
import ks.client.controllers.commands.LeaveCommandController;
import ks.client.gui.GMGUI;
import ks.client.kommander.Action;
import ks.client.lobby.Lobby;
import ks.managers.table.Table;
import ks.managers.table.TableManager;

public class KickPlayerClick implements ActionListener {
Lobby lobby;
int num;

	
	/**
	 * @param lobby 
	 */
	public KickPlayerClick(Lobby lobby, int num) {
		this.lobby = lobby;
		this.num = num;
		
	}
	
	public void actionPerformed(ActionEvent e){
		String player = (String) lobby.getGMGUI().getList().getSelectedValue();
		
		if (!player.equals(lobby.getUserContext().getUser())) {
			new LeaveCommandController(lobby).send(num, player);
		}
	}
}

	
